package cn.tedu.bmiController.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BMIController_test {
    @RequestMapping("/v1")
    @ResponseBody
    public String getBMI(Double height,Double weight){
        System.out.println("height="+height+"weight"+weight);
        Double bmi = weight/(height*height);
        if(bmi<18.5){
            return "过轻";
        }else if(bmi<24){
            return "正常";
        }else if(bmi<27){
            return "过重";
        }else {
            return "肥胖";
        }
    }
}
